#ifndef _ROBOT_H_
#define _ROBOT_H_

//#include <vector>
#include <string>
//#include <sstream>
#include <queue>
#include "item.h"
#include "platform.h"


class TPlatform;

/**
 * 机器人类
 */
class TRobot
{
public:
    int number;                                      ///> 编号,从0开始
    double x;                                        ///> x坐标，单位m
    double y;                                        ///> y坐标，单位m
    bool is_busy = false;                            ///> 1为忙碌中，有target
    int platform_idx = -1;                           ///> 所处的platform的manager的idx
    double radius = 0.45;                            ///> 机器半径，单位m  0.45->0.53
    int mass = 20;                                   ///> 机器质量面密度
    double rad_v = 0;                                ///> 角速度,rad/s
    double line_v[2] = {0, 0};                       ///> 线速度,m/s;(x,y)
    double direction = 0;
    double v_set;
    double rotate_set;

    item foods = {0,0,0,0};                          ///> 持有的货物
    queue<tuple<bool, int, TPlatform*>> work_queue;  ///> (0是材料入，1是产品出)<0/1,产品号，>

public:
    /**
     * 构造函数
     */
    TRobot(int _number,double _x,double _y);

    /**
     * 机器人读函数
     */
    virtual void Read(string &buff);  ///> 读取机器人每帧数据

    void Goto(const double x_dst, const double y_dst);
};


#endif  // _ROBOT_H_